import request from '@/axios'

/**
 * 获取指标体系
 * @returns
 */
export const getIndicatorSystem = (data): Promise<IResponse> => {
  return request.post({ url: '/level-manage/level/category/list', data })
}

/**
 * 获取指标体系
 * @returns
 */
export const getIndicatorSystemPermissions = (data): Promise<IResponse> => {
  return request.post({ url: '/level-manage/level/category/listData', data })
}

/**
 * 根据指标体系id获取其下一级指标
 */
export const getByCategoryId = (params): Promise<IResponse> => {
  return request.get({ url: '/level-manage/level/one/getByCategoryId', params })
}

/**
 * 获取一级指标
 * @returns
 */
export const getOneLevelIndicators = (data): Promise<IResponse> => {
  return request.post({ url: '/level-manage/level/one/page-list', data })
}

/**
 * 获取一级指标 - 带数据权限的
 * @returns
 */
export const getOneLevelIndicatorsPermissions = (data): Promise<IResponse> => {
  return request.post({ url: '/level-manage/level/one/page-list-data', data })
}

/**
 * 根据一级指标id获取其下级指标
 * @param params
 * @returns
 */
export const getByLevel = (params): Promise<IResponse> => {
  return request.get({ url: '/level-manage/level/two/getByLevelOneId', params })
}

/**
 * 根据一级指标id获取其下级指标 - 数据权限
 * @param params
 * @returns
 */
export const getByLevelPermissions = (params): Promise<IResponse> => {
  return request.get({ url: '/level-manage/level/two/getByLevelOneIdData', params })
}

/**
 * 根据二级指标id获取监测事项列表 - 不分页
 * @param params
 * @returns
 */
export const listValidByTwoId = (params): Promise<IResponse> => {
  return request.get({ url: '/level-manage/level/item/listValidByTwoId', params })
}
